//
//  ShaderSrc.hpp
//  STDRenderSDK
//
//  Created by 陈学明 on 2023/3/13.
//  Copyright © 2023 陈学明. All rights reserved.
//

#ifndef STDSShaderStream_hpp
#define STDSShaderStream_hpp
#include <stdio.h>
#include <string>
#include <map>

using namespace std;

struct STDSShaderStream {
    const char *vex;
    const char *frag;
    
    STDSShaderStream(const char *vexSrc, const char *fragSrc) {
        this->vex = vexSrc;
        this->frag = fragSrc;
    }
    ~STDSShaderStream() {
//        printf("dealloc--STDSShaderStream\n");
    }
};

extern const char *gl_shader_vex_2D;
extern const char *gl_shader_vex_3D;

// 张兴益提供的混合模式
const string kShaderSRCBlendMirrorLinear_STDS       = "kShaderSRCBlendMirrorLinear_STDS";
const string kShaderSRCBlendAdd_STDS                = "kShaderSRCBlendAdd_STDS";
const string kShaderSRCBlendHardlight_STDS          = "kShaderSRCBlendHardlight_STDS";
const string kShaderSRCBlendBloom_STDS              = "kShaderSRCBlendBloom_STDS";
const string kShaderSRCBlendNormal_STDS             = "kShaderSRCBlendNormal_STDS";
const string kShaderSRCBlendLineardodge_STDS        = "kShaderSRCBlendLineardodge_STDS";
const string kShaderSRCBlendColorBurn_STDS          = "kShaderSRCBlendColorBurn_STDS";
const string kShaderSRCBlendSub_STDS                = "kShaderSRCBlendSub_STDS";
const string kShaderSRCBlendOverlay_STDS            = "kShaderSRCBlendOverlay_STDS";
const string kShaderSRCBlendLinearLight_STDS        = "kShaderSRCBlendLinearLight_STDS";
const string kShaderSRCBlendLinearBurn_STDS         = "kShaderSRCBlendLinearBurn_STDS";
const string kShaderSRCBlendMultiply_STDS           = "kShaderSRCBlendMultiply_STDS";
const string kShaderSRCBlendScreen_STDS             = "kShaderSRCBlendScreen_STDS";
const string kShaderSRCBlendJdLut_STDS              = "kShaderSRCBlendJdLut_STDS";
const string kShaderSRCBlendLighten_STDS            = "kShaderSRCBlendLighten_STDS";
const string kShaderSRCBlendLighterColor_STDS       = "kShaderSRCBlendLighterColor_STDS";
const string kShaderSRCBlendDivide_STDS             = "kShaderSRCBlendDivide_STDS";

// 效果
const string kShaderSRCMaskKey                      = "kShaderSRCMaskKey"; // 扣像
const string kShaderSRCGrain                        = "kShaderSRCGrain";
const string kShaderSRCGaussianBlur                 = "kShaderSRCGaussianBlur";
const string kShaderSRCHairColor                    = "kShaderSRCHairColor";
const string kShaderSRCContrast                     = "kShaderSRCContrast";
const string kShaderSRCGlowLight                    = "kShaderSRCGlowLight";
const string kShaderSRCVignette                     = "kShaderSRCVignette";
const string kShaderSRCColorGrain                   = "kShaderSRCColorGrain";
const string kShaderSRCGlowColor                    = "kShaderSRCGlowColor";
const string kShaderSRCLightArea                    = "kShaderSRCLightArea";
const string kShaderSRCWhiteBalance                 = "kShaderSRCWhiteBalance";
const string kShaderSRCMixMask                      = "kShaderSRCMixMask";
const string kShaderSRCHSL                          = "kShaderSRCHSL";
const string kShaderSRCDefault                      = "kShaderSRCDefault"; // 默认效果
const string kShaderSRCSkinDetect                   = "kShaderSRCSkinDetect";
const string kShaderSRCSkinLutDetect                = "kShaderSRCSkinLutDetect";
const string kShaderSRCSkinWiten                    = "kShaderSRCSkinWiten";
const string kShaderSRCMosaic                       = "kShaderSRCMosaic";
const string kShaderSRCTransformmation              = "kShaderSRCTransformmation";
const string kShaderSRCPuzzleUnit                   = "kShaderSRCPuzzleUnit";
const string kShaderSRCPuzzleStarsMask              = "kShaderSRCPuzzleStarsMask";
const string kShaderSRCPuzzleStars                  = "kShaderSRCPuzzleStars";
const string kShaderSRCSolidColor                   = "kShaderSRCSolidColor";
const string kShaderSRCPuzzleBreak                  = "kShaderSRCPuzzleBreak";
const string kShaderSRCPuzzleGrain                  = "kShaderSRCPuzzleGrain";
const string kShaderSRCPuzzleGlass                  = "kShaderSRCPuzzleGlass";
const string kShaderSRCPuzzleRainbow                = "kShaderSRCPuzzleRainbow";
const string kShaderSRCPuzzleCartoon                = "kShaderSRCPuzzleCartoon";
const string kShaderSRCBiLateralBlur                = "kShaderSRCBiLateralBlur"; // 双边过滤
const string kShaderSRCCartoon                      = "kShaderSRCCartoon"; // 卡通化
const string kShaderSRCGlassTile                    = "kShaderSRCGlassTile"; // 玻璃拼贴
const string kShaderSRCParticleCutout               = "kShaderSRCParticleCutout"; // 粒子抠像
const string kShaderSRCParticleDissipate            = "kShaderSRCParticleDissipate"; // 粒子消散
const string kShaderSRCCloneStamp                   = "kShaderSRCCloneStamp"; // 仿制图章
const string kShaderSRCBoxBlur                      = "kShaderSRCBoxBlur"; // 方框模糊
const string kShaderSRCSobelEage                    = "kShaderSRCSobelEage"; // sobel 边缘检测
const string kShaderSRCLut                          = "kShaderSRCLut"; // 颜色查找表


// 陈学明提供的混合模式
const string kShaderSRCBlendMultiply                = "kShaderSRCBlendMultiply";// 正片叠底 / 相乘（常用）
const string kShaderSRCBlendSrceen                  = "kShaderSRCBlendSrceen";// 屏幕（常用）
const string kShaderSRCBlendOverlay                 = "kShaderSRCBlendOverlay";// 叠加（常用）
const string kShaderSRCBlendDarken                  = "kShaderSRCBlendDarken";// 变暗
const string kShaderSRCBlendLighten                 = "kShaderSRCBlendLighten";// 变亮（常用）
const string kShaderSRCBlendColorDodge              = "kShaderSRCBlendColorDodge";//颜色减淡
const string kShaderSRCBlendColorBurn               = "kShaderSRCBlendColorBurn";// 颜色加深
const string kShaderSRCBlendHardLight               = "kShaderSRCBlendHardLight";// 强光
const string kShaderSRCBlendSoftLight               = "kShaderSRCBlendSoftLight";// 柔光（常用）
const string kShaderSRCBlendDifference              = "kShaderSRCBlendDifference";// 差值
const string kShaderSRCBlendExclusion               = "kShaderSRCBlendExclusion";// 排除
const string kShaderSRCBlendAdd                     = "kShaderSRCBlendAdd";// 相加（常用）
const string kShaderSRCBlendNormal                  = "kShaderSRCBlendNormal";// 正常（常用）

extern void regShaderForCXM(map<string, shared_ptr<STDSShaderStream>> &shaderMap);

extern void regShaderForBlend(map<string, shared_ptr<STDSShaderStream>> &shaderMap);
#endif /* ShaderSrc_hpp */
